<?php
/**
 * Created by PhpStorm.
 * User: dingboxu
 * Date: 17/2/21
 * Time: 下午6:04
 */


$httpUrl = "http://127.0.0.1:8088/";
//$httpUrl = "http://www.helihai.com:8088/";
//$httpUrl = "http://127.0.0.1:2346/";

//$httpUrl = "http://192.168.1.113:8088/";
//$httpUrl = "http://192.168.1.127:8088/";

//$httpUrl = "http://115.29.136.117:8088/";

$test = array(
    "ActionType" => "TEST1",
    "DataDictionary" => array(
    )
);


//  -----  商品标签管理  -----
// 添加标签
$food_tag_add = array(
    "ActionType" => "event_restaurant_food_tags_add",
    "DataDictionary" => array(
        "FOOD_TAG_NAME" => "测试标签",
        "FOOD_TAG_COLOR" => "red"
    )
);

// 删除标签
$food_tag_delete = array(
    "ActionType" => "event_restaurant_food_tags_delete",
    "DataDictionary" => array(
        "FOOD_TAG_ID" => 1
    )
);

// 更新标签
$food_tag_update = array(
    "ActionType" => "event_restaurant_food_tags_update",
    "DataDictionary" => array(
        "FOOD_TAG_ID" => 1,
        "FOOD_TAG_NAME" => "测试标签11",
        "FOOD_TAG_COLOR" => "red"
    )
);

// 获取标签列表
$food_tag_get_list = array(
    "ActionType" => "event_restaurant_food_tags_get_list",
    "DataDictionary" => array(
    )
);

// 获取单个标签
$food_tag_get_record = array(
    "ActionType" => "event_restaurant_food_tags_get_record",
    "DataDictionary" => array(
        "FOOD_TAG_ID" => 1,
    )
);


//  -----  商品分类管理  -----
// 添加分类
$food_group_add = array(
    "ActionType" => "event_restaurant_food_groups_add",
    "DataDictionary" => array(
        "FOOD_GROUP_NAME" => "测试分类",
        "DESCRIPTION" => "我是介绍"
    )
);
// 删除分类
$food_group_delete = array(
    "ActionType" => "event_restaurant_food_groups_delete",
    "DataDictionary" => array(
        "FOOD_GROUP_ID" => 1
    )
);
// 更新分类
$food_group_update = array(
    "ActionType" => "event_restaurant_food_groups_update",
    "DataDictionary" => array(
        "FOOD_GROUP_ID" => 1,
        "FOOD_GROUP_NAME" => "嘻嘻",
        "DESCRIPTION" => "介绍介绍"
    )
);
// 获取分类列表
$food_group_get_list = array(
    "ActionType" => "event_restaurant_food_groups_get_list",
    "DataDictionary" => array(
    )
);
// 获取单个分类
$food_group_get_record = array(
    "ActionType" => "event_restaurant_food_groups_get_record",
    "DataDictionary" => array(
        "FOOD_GROUP_ID" => 1,
    )
);

//  -----  商品管理  -----
// 添加商品
$food_add = array(
    "ActionType" => "event_restaurant_food_add",
    "DataDictionary" => array(
        "FOOD_GROUP_ID" => "1",
        "FOOD_TAG_ID" => "5",
        "DESCRIPTION" => "描述1",
        "FOOD_NAME" => "商品4",
        "IMG_URL" => "https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=2390973038,561107391&fm=23&gp=0.jpg",
        "FOOD_PRICE" => "12.50",
        "IS_LIMIT" => "1",
        "LUNCHBOX_AMOUNTS" => "2",
        "LUNCHBOX_PRICE" => "2.5",
        "IS_ON_SELL" => "1",
        "STOCK_DAY" => "100",
        "STOCK_LEFT" => "50",
        "SPECIAL_FEATURE" => "1",
        "ORDER_UNIT" => "份",
        "ORDER_MINIMUM" => "1",
    )
);

// 删除商品
$food_delete = array(
    "ActionType" => "event_restaurant_food_delete",
    "DataDictionary" => array(
        "FOOD_ID" => 5
    )
);

// 更新商品
$food_update = array(
    "ActionType" => "event_restaurant_food_update",
    "DataDictionary" => array(
        "FOOD_ID" => 1,
        "FOOD_GROUP_ID" => 2,
        "FOOD_TAG_ID" => 5,
        "FOOD_NAME" => "商品1update",
        "DESCRIPTION" => "描述111",
        "IMG_URL" => "https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=2390973038,561107391&fm=23&gp=0.jpg",
        "FOOD_PRICE" => "12.80",
        "IS_LIMIT" => "1",
        "LUNCHBOX_AMOUNTS" => "2",
        "LUNCHBOX_PRICE" => "2.5",
        "IS_ON_SELL" => "1",
        "STOCK_DAY" => "100",
        "STOCK_LEFT" => "50",
        "SPECIAL_FEATURE" => "1",
        "ORDER_UNIT" => "份1",
        "ORDER_MINIMUM" => "1",
        "FOOD_PROPERTY" => "微辣1",

    )
);

// 获取商品列表
$food_get_list = array(
    "ActionType" => "event_restaurant_food_get_list",
    "DataDictionary" => array(
        "FOOD_GROUP_ID" => "1"
    )
);

// 获取单个商品
$food_get_record = array(
    "ActionType" => "event_restaurant_food_get_record",
    "DataDictionary" => array(
        "FOOD_ID" => 1
    )
);

// 上架、下架商品
$food_sell_change = array(
    "ActionType" => "event_restaurant_food_sell_change",
    "DataDictionary" => array(
        "FOOD_ID" => 1,
        "IS_ON_SELL" => 0
    )
);


//  ------- 桌子管理  --------

// 添加桌子
$table_add = array(
    "ActionType" => "event_table_add",
    "DataDictionary" => array(
        "TABLE_NUM" => 11,
        "MAX_CAPACITY" => 10,
    )
);
// 更新桌子
$table_update = array(
    "ActionType" => "event_table_update",
    "DataDictionary" => array(
        "TABLE_ID" => 1,
        "TABLE_NUM" => 2,
        "MAX_CAPACITY" => 22,
    )
);
// 获取单个桌子
$table_get_record = array(
    "ActionType" => "event_table_get_record",
    "DataDictionary" => array(
        "TABLE_ID" => 1,
    )
);
// 获取桌子列表
$table_get_list = array(
    "ActionType" => "event_table_get_list",
    "DataDictionary" => array(
    )
);
// 删除桌子
$table_delete = array(
    "ActionType" => "event_table_delete",
    "DataDictionary" => array(
        "TABLE_ID" => 1,
    )
);



//  -----  餐厅信息管理  -----
// 获取餐厅基本信息
$restaurant_info_get_base = array(
    "ActionType" => "event_restaurant_info_get_base",
    "DataDictionary" => array(
    )
);
// 获取餐厅信息
$restaurant_info_get = array(
    "ActionType" => "event_restaurant_info_get",
    "DataDictionary" => array(
    )
);
// 编辑餐厅公告
$restaurant_info_announce_set = array(
    "ActionType" => "event_restaurant_info_announce_set",
    "DataDictionary" => array(
        "ANNOUNCEMENT" => "我是公告",
    )
);
// 编辑餐厅电话
$restaurant_info_tel_set = array(
    "ActionType" => "event_restaurant_info_tel_set",
    "DataDictionary" => array(
        "CONTACT_NUMBER" => "15122432898",
    )
);
// 编辑营业时间
$restaurant_info_open_hours_set = array(
    "ActionType" => "event_restaurant_info_open_hours_set",
    "DataDictionary" => array(
        "OPENING_TIME" => "7*24h营业",
    )
);
// 提示音设置获取
$restaurant_settings_ring_get = array(
    "ActionType" => "event_restaurant_settings_ring_get",
    "DataDictionary" => array(
    )
);
// 提示音设置
$restaurant_settings_ring_set = array(
    "ActionType" => "event_restaurant_settings_ring_set",
    "DataDictionary" => array(
        "IS_RING" => 0,
        "IS_VIBRATION" => 0
    )
);
// 打印机设置获取
$restaurant_settings_print_get = array(
    "ActionType" => "event_restaurant_settings_print_get",
    "DataDictionary" => array(

    )
);
// 打印机设置
$restaurant_settings_print_set = array(
    "ActionType" => "event_restaurant_settings_print_set",
    "DataDictionary" => array(

    )
);

// 客户登录
$event_consumer_login = array(
    "ActionType" => "event_consumer_login",
    "DataDictionary" => array(
       "login_id"=>"456asdf",
        "LOGIN_TYPE"=>"1",
        "CONSUMER_NAME"=>"点",
        "IMG_URL"=>""
    )
);

// 获取店铺信息
$event_consumer_get_restaurant_info = array(
    "ActionType" => "event_consumer_get_restaurant_info",
    "DataDictionary" => array(
        "RESTAURANT_ID"=>1
    )
);


// 客户下订单
$event_consumer_order_new = array(
    "ActionType" => "event_consumer_order_new",
    "DataDictionary" => array(
        "RESTAURANT_ID"=>1,
        "TABLE_NUM"=>1,
        "CONSUMER_COUNT"=>5,
        "IS_TAKE_OUT"=>1,
        "order_for_food"=>array(
            "1"=>1,
            "4"=>2
        )
    )
);

// 客户催单
$event_consumer_reminder = array(
    "ActionType" => "event_consumer_reminder",
    "DataDictionary" => array(
        "ORDER_FORM_ID"=>"8"
    )
);

// 客户退菜
$event_consumer_retreat_food = array(
    "ActionType" => "event_consumer_retreat_food",
    "DataDictionary" => array(
        "ORDER_FORM_ID"=>9,
        "RETREAT_FOOD_LIST"=>array(
           "4" => "1",
            "1" => "1"
        )
    )
);


// 客户退单
$event_consumer_retreat_order_form = array(
    "ActionType" => "event_consumer_retreat_order_form",
    "DataDictionary" => array(
        "ORDER_FORM_ID"=>10
    )
);



// 客户查看商品
$event_consumer_get_food_list = array(
    "ActionType" => "event_consumer_get_food_list",
    "DataDictionary" => array(
        "RESTAURANT_ID"=>1
    )
);

// 客户订单列表
$event_consumer_order_finished_list = array(
    "ActionType" => "event_consumer_order_finished_list",
    "DataDictionary" => array(
        "every_page_counts" => "2",
        "page_index" => "1",
        "RESTAURANT_ID"=>"1"
    )
);

// 店主已完成订单列表
$event_restaurant_order_form_list_finished = array(
    "ActionType" => "event_restaurant_order_form_list_finished",
    "DataDictionary" => array(
        "every_page_counts"=>"2",
        "last_id"=>"20",
        "DATE"=>"2017-08-04",
        "TABLE_NUM"=>"1",
        "ORDER_NUM"=>""
    )
);


// 店主已退款订单列表
$event_restaurant_order_form_list_retreat_finished = array(
    "ActionType" => "event_restaurant_order_form_list_retreat_finished",
    "DataDictionary" => array(
        "every_page_counts"=>"2",
        "last_id"=>"30",
        "DATE"=>"2017-08-04",
        "TABLE_NUM"=>"1",
        "ORDER_NUM"=>""
    )
);

// 店主退单申请列表

$event_restaurant_order_form_list_retreat = array(
    "ActionType" => "event_restaurant_order_form_list_retreat",
    "DataDictionary" => array(
        "every_page_counts"=>"2",
        "last_id"=>"20",
        "DATE"=>"2017-08-04",
        "TABLE_NUM"=>"1",
        "ORDER_NUM"=>""
    )
);



// 店主催单申请列表

$event_restaurant_order_form_list_reminder = array(
    "ActionType" => "event_restaurant_order_form_list_reminder",
    "DataDictionary" => array(
        "every_page_counts"=>"5",
        "last_id"=>"10",
        "DATE"=>"2017-08-04",
        "TABLE_NUM"=>"1",
        "ORDER_NUM"=>""
    )
);



// 店主退菜申请列表

$event_restaurant_order_form_food_list_retreat = array(
    "ActionType" => "event_restaurant_order_form_food_list_retreat",
    "DataDictionary" => array(
        "every_page_counts"=>"2",
        "last_id"=>"18",
        "DATE"=>"2017-08-04",
        "TABLE_NUM"=>"1",
        "ORDER_NUM"=>""
    )
);


// 店主确认退单

$event_restaurant_retreat_order_form_confirm = array(
    "ActionType" => "event_restaurant_retreat_order_form_confirm",
    "DataDictionary" => array(
        "ORDER_FORM_ID"=>"10",
        "RETREAT_STATUS"=>"1"
    )
);



// 店主确认退菜

$event_restaurant_retreat_food_confirm = array(
    "ActionType" => "event_restaurant_retreat_food_confirm",
    "DataDictionary" => array(
        "ORDER_FORM_ID"=>"9",
        "RETREAT_STATUS"=>"1"
    )
);



// 店主确认崔单

$event_restaurant_reminder_confirm = array(
    "ActionType" => "event_restaurant_reminder_confirm",
    "DataDictionary" => array(
        "ORDER_FORM_ID"=>"18"
    )
);

// 店主更新商品分类排序

$event_restaurant_food_groups_update_order = array(
    "ActionType" => "event_restaurant_food_groups_update_order",
    "DataDictionary" => array(
        "FOOD_GROUPS_ORDER"=>"1,2,3"
    )
);


// 店主更新商品排序

$event_restaurant_food_update_order = array(
    "ActionType" => "event_restaurant_food_update_order",
    "DataDictionary" => array(
        "FOOD_GROUP_ID"=>"1",
        "FOOD_ORDER"=>"1,4"
    )
);

// 经营数据
$event_restaurant_statistics = array(
    "ActionType" => "event_restaurant_statistics",
    "DataDictionary" => array(
        "DATE" => "2017-07-19"
    )
);

// 经营数据
$event_restaurant_now_statistics = array(
    "ActionType" => "event_restaurant_now_statistics",
    "DataDictionary" => array(
        "DATE" => "2017-07-19"
    )
);

// 顾客单个订单信息
$event_consumer_order_info = array(
    "ActionType" => "event_consumer_order_info",
    "DataDictionary" => array(
        "ORDER_FORM_ID"=>"12"
    )
);

// 商家登录
$event_restaurant_login = array(
    "ActionType" => "event_restaurant_login",
    "DataDictionary" => array(
        "CONTACT_NUMBER"=>"18630949365",
        "PASSWORD"=>""
    )
);



// 意见反馈
$event_restaurant_suggestion_to = array(
    "ActionType" => "event_restaurant_suggestion_to",
    "DataDictionary" => array(
        "SUGGESTION_CONTENT"=>"测试意见反馈",
    )
);

// 商家打印订单
$event_restaurant_print = array(
    "ActionType" => "event_restaurant_print",
    "DataDictionary" => array(
        "ORDER_FORM_ID"=>"15",
    )
);

// 入帐
$TEST1 = array(
    "ActionType" => "TEST1",
    "DataDictionary" => array(
    )
);


// 商家余额获取
$event_restaurant_account_info = array(
    "ActionType" => "event_restaurant_account_info",
    "DataDictionary" => array(
    )
);

// 商家提现申请
$event_restaurant_withdraws = array(
    "ActionType" => "event_restaurant_withdraws",
    "DataDictionary" => array(
        "WITHDRAWS_AMOUNT"=>"10"
    )
);

// 商家已提现列表
$event_restaurant_withdraws_list_suc = array(
    "ActionType" => "event_restaurant_withdraws_list_suc",
    "DataDictionary" => array(
        "every_page_counts" => "2",
        "page_index" => "1"
    )
);

// 商家已提现列表
$event_restaurant_withdraws_list_ing = array(
    "ActionType" => "event_restaurant_withdraws_list_ing",
    "DataDictionary" => array(
        "every_page_counts" => "2",
        "page_index" => "1"
    )
);

// 已入帐列表
$event_restaurant_entry_list_yes = array(
    "ActionType" => "event_restaurant_entry_list_yes",
    "DataDictionary" => array(
        "every_page_counts" => "2",
        "page_index" => "1"
    )
);

// 已入帐列表
$event_restaurant_entry_list_not = array(
    "ActionType" => "event_restaurant_entry_list_not",
    "DataDictionary" => array(
        "every_page_counts" => "2",
        "page_index" => "1"
    )
);

$post_data = json_encode($event_restaurant_entry_list_not);



echo "$post_data<br><br><br>";

$ch = curl_init ();
curl_setopt ( $ch, CURLOPT_URL, $httpUrl );
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
// post传参
curl_setopt ( $ch, CURLOPT_POST, 1 );
curl_setopt ( $ch, CURLOPT_POSTFIELDS, $post_data);
// curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec ( $ch );
curl_close ( $ch );

echo $result;

